package com.chen.springboot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chen.springboot.entity.Address;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @Author Chen
 * @Date 2024/12/3 18:31
 */
public interface AddressMapper extends BaseMapper<Address> {
    @Update("update address set status=1 where id=#{id}")
    boolean update1(Integer id);

    @Update("update address set status=0 where user_id=#{userId}")
    void update0(Integer userId);

    @Select("select address from address where status=1 and user_id=#{userId}")
    String getOne(Integer userId);
}
